﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

/* Generated with http://xmltocs.com/ */
namespace EDMXParserV1
{
    public class AssociationSet
    {
        public AssociationSet()
        {
            Ends = new List<End>();
        }
        public String Name { get; set; }
        public String Association { get; set; }
        public List<End> Ends { get; set; }

        public static AssociationSet New(System.Xml.XmlNode Node)
        {
            AssociationSet AssociationSet = new AssociationSet();

            foreach (XmlAttribute Attribute in Node.Attributes)
            {
                switch (Attribute.Name)
                {
                    case "Name":
                        AssociationSet.Name = Attribute.Value;
                        break;
                    case "Association":
                        AssociationSet.Association = Attribute.Value;
                        break;

                    default:
                        Globals.AttributeSwitchCoder(Attribute);
                        break;
                }

            }

            foreach (XmlNode ChildNode in Node.ChildNodes)
            {
                switch (ChildNode.Name)
                {
                    case "End":
                        End End = End.New( ChildNode);
                        AssociationSet.Ends.Add(End);
                        break;

                    default:
                        Globals.NodeSwitchCoder(ChildNode);
                        break;
                }
            }

            return AssociationSet;

        }
    }
}
